<template>
	<view class="wrap">
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
		  <block slot="content">盘点计划</block>
		</cu-custom>
		<view style="height: 100upx;"></view>
		<view class="flex flex-wrap justify-center basis-xl">
			<view class="cu-list menu sm-border card-menu basis-xl">
				<template v-if="list.length>0">
					<view class="cu-item arrow" v-for="item in list" @tap="queryDetail(item.id,item.code)">
					    <view class="content">
					        <text class="cuIcon-scan text-grey"></text>
					        <text class="text-grey"><text style="color:blue">{{item.name}}</text></text>
							<view class="content">
								<text class="text-grey">编号：{{item.code}}</text>
							</view>
							<view class="content">
								 <text class="text-grey">[{{item.beginDate}} ~ {{item.endDate}}]</text>
							</view>
							<view class="content">
								<text class="text-grey">当前状态：{{item.finishStateTxt}}</text>
							</view>
							<view class="content">
								<text class="text-grey">完成数量：{{item.finishNum}}</text>
							</view>
					    </view>
					</view>
				</template>
				<template v-else>
				<view class="content" style="text-align: center;">
					<text>暂无数据</text>
				</view>
				</template>
			</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		name:'inventory',
		data() {
			return {
				list:[]
			}
		},mounted(){
			
			this.$api.req.getInventoryPageList({page:1,limit:10,createUserId:1},res=>{
				
				this.list = res.data;
			});
		},methods:{
			queryDetail(id,code){
				uni.navigateTo({
					url:'/pages/equip/invetory-item?inventoryId=' + id +"&code=" + code
				})
			}
		}
	}
</script>
	
<style>
	.wrap{
		background-color: #FAFBFC;
		min-height: 100vh;
	}
</style>